.class Lcom/glympse/android/glympse/Glympse$DlgNewVersion;
.super Lcom/glympse/android/glympse/DlgPrompt;
.source "Glympse.java"

# interfaces
.implements Landroid/content/DialogInterface$OnDismissListener;
.implements Lcom/glympse/android/glympse/DlgShell$DlgShellListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/Glympse;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "DlgNewVersion"
.end annotation


# instance fields
.field private m_fRequired:Z

.field final synthetic this$0:Lcom/glympse/android/glympse/Glympse;


# direct methods
.method public constructor <init>(Lcom/glympse/android/glympse/Glympse;Landroid/content/Context;Z)V
    .locals 2
    .parameter
    .parameter "oContext"
    .parameter "fRequired"

    .prologue
    const/4 v1, 0x0

    .line 1991
    iput-object p1, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->this$0:Lcom/glympse/android/glympse/Glympse;

    .line 1968
    const/4 v0, 0x0

    invoke-direct {p0, p2, v0}, Lcom/glympse/android/glympse/DlgPrompt;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 1963
    iput-boolean v1, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fRequired:Z

    .line 1969
    const v0, 0x7f020048

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetTitleIcon(I)V

    .line 1970
    const v0, 0x7f0a0070

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetTitleText(I)V

    .line 1971
    if-eqz p3, :cond_1

    const v0, 0x7f0a0088

    :goto_0
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetPrompt(I)V

    .line 1973
    iput-boolean p3, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fRequired:Z

    .line 1978
    iget-boolean v0, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fRequired:Z

    if-eqz v0, :cond_0

    .line 1980
    iput-boolean v1, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fDismissOnClickOutside:Z

    .line 1984
    :cond_0
    const v0, 0x7f0a0084

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetOkText(I)V

    .line 1985
    if-eqz p3, :cond_2

    const v0, 0x7f0a0086

    :goto_1
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetCancelText(I)V

    .line 1986
    invoke-virtual {p0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->GetOkButton()Landroid/widget/Button;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Button;->requestFocus()Z

    .line 1989
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

    .line 1990
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->SetDlgShellListener(Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    return-void

    .line 1971
    :cond_1
    const v0, 0x7f0a0089

    goto :goto_0

    .line 1985
    :cond_2
    const v0, 0x7f0a0085

    goto :goto_1
.end method


# virtual methods
.method public OnCancel(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 1
    .parameter "oDlgShell"

    .prologue
    .line 2041
    iget-boolean v0, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fRequired:Z

    if-eqz v0, :cond_0

    .line 2043
    iget-object v0, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->this$0:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v0}, Lcom/glympse/android/glympse/Glympse;->StartExit()V

    .line 2045
    :cond_0
    return-void
.end method

.method public OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V
    .locals 0
    .parameter "oDlgShell"
    .parameter "fOk"

    .prologue
    .line 2050
    return-void
.end method

.method public OnOk(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 6
    .parameter "oDlgShell"

    .prologue
    .line 2018
    :try_start_0
    const-string v1, "market://details?id=com.glympse.android.glympse"

    .line 2021
    .local v1, strUrl:Ljava/lang/String;
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    if-eqz v2, :cond_0

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    if-eqz v2, :cond_0

    .line 2022
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    iget-object v2, v2, Lcom/glympse/platform/common/ServerPost;->m_strUpgradeUrl:Ljava/lang/String;

    invoke-static {v2}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 2024
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    iget-object v1, v2, Lcom/glympse/platform/common/ServerPost;->m_strUpgradeUrl:Ljava/lang/String;

    .line 2027
    :cond_0
    iget-object v2, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->this$0:Lcom/glympse/android/glympse/Glympse;

    new-instance v3, Landroid/content/Intent;

    const-string v4, "android.intent.action.VIEW"

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v5

    invoke-direct {v3, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    invoke-virtual {v2, v3}, Lcom/glympse/android/glympse/Glympse;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 2034
    .end local v1           #strUrl:Ljava/lang/String;
    :goto_0
    iget-object v2, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->this$0:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v2}, Lcom/glympse/android/glympse/Glympse;->StartExit()V

    .line 2035
    return-void

    .line 2029
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 2031
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public onDismiss(Landroid/content/DialogInterface;)V
    .locals 1
    .parameter "dialog"

    .prologue
    .line 1997
    iget-boolean v0, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->m_fRequired:Z

    if-eqz v0, :cond_0

    .line 1999
    iget-object v0, p0, Lcom/glympse/android/glympse/Glympse$DlgNewVersion;->this$0:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v0}, Lcom/glympse/android/glympse/Glympse;->StartExit()V

    .line 2001
    :cond_0
    return-void
.end method
